{% extends 'pybb/base.html' %}
{% load pybb_tags %}
{% load i18n %}

{% block title %}
{{ forum }}
{% endblock %}

{% block pybb_crumbs %}
<a href="/">AuAdult</a> <img src="/res/forum_v2/crumb.png" class="crumb-arrow" />
<a href="{% url pybb_index %}">Forum</a> <img src="/res/forum_v2/crumb.png" class="crumb-arrow" />
<a href="{{ forum.category.get_absolute_url }}">{{ forum.category }}</a>
{% endblock %}

{% block pybb_content %}
<div class="forum-details">
  <div class="forum-details-header">
    <div class="post-new">
      <div class="post-new-left"></div>
      <div class="post-new-btn"><a href="{% url pybb_topic_add forum.id %}">{% trans "Post New Thread" %}</a></div>
      <div class="post-new-right"></div>
    </div>
    <h2>{{ forum }}</h2>
  </div>
  <div class="clear"></div>
    <table class="topic-list main-table">
        <thead>
            <tr>
                <th class="name title">TITLE</th>
                <th class="author">AUTHOR</th>
                <th class="post-count">REPLIES</th>
                <th class="recent-info">LAST POST</th>
            </tr>
        </thead>
        {% for topic in page.object_list %}
        <tr class="topic-item">
            <td class="title text">
                {% if topic.sticky %}<span class="sticky"></span>{% endif %}
                {% if topic|pybb_topic_unread:user %}<span class="unread"></span>{% endif %}
                {% if topic.closed %}{% trans "Closed" %}:{% endif %}
                {% if topic.sticky %}{% trans "Important" %}:{% endif %}
                <a href="{{ topic.get_absolute_url }}">{{ topic }}</a>
                <div class="mini-pagination">{% pybb_topic_mini_pagination topic %}</div>
            </td>
            <td class="author text">{{ topic.user }}</td>
            <td class="post-count text">{{ topic.post_count }}</td>
            <td class="recent-info text">{% if topic.updated %}<a href="{{ topic.last_post.get_absolute_url }}">{% pybb_time topic.updated %}</a>{% endif %}</td>
        </tr>
        {% endfor %}
    </table>
</div>

{% if not user.pybb_profile.is_banned %}
  <div class="forum-details-bottom">
	<div class="post-new">
	  <div class="post-new-left"></div>
	  <div class="post-new-btn"><a href="{% url pybb_topic_add forum.id %}">{% trans "Post New Thread" %}</a></div>
	  <div class="post-new-right"></div>
	</div>
	{% with _('Topics') as label %}
	{% include "pybb/pagination.html" %}
	{% endwith %}
	<div class="clear"></div>
  </div>
{% endif %}

{% endblock %}
